Magnetic field influence during rotation movement of magnetic target

ABSTRACT

A system for reducing stray field effects comprises a magnetic target producing a changing magnetic field; a first set of magnetic field sensing elements placed in spaced relation to the magnetic target and comprising at least a first magnetic field sensing element and a second magnetic field sensing element, each magnetic field sensing element having an axis of maximum sensitivity; a second set of magnetic field sensing elements placed in spaced relation to the magnetic target and comprising at least a third magnetic field sensing element and a fourth magnetic field sensing element, each magnetic field sensing element having an axis of maximum sensitivity; and wherein the first set of magnetic field sensing elements is positioned closer to a center point of the magnetic field than the second set of magnetic field sensing elements.

CROSS REFERENCE TO RELATED APPLICATIONS

This is a Divisional application and claims the benefit of and priorityto U.S. patent application Ser. No. 15/909,208, filed Mar. 1, 2018,entitled “MAGNETIC FIELD INFLUENCE DURING ROTATION MOVEMENT OF MAGNETICTARGET,” which is incorporated herein by reference in its entirety.

FIELD

This disclosure relates to magnetic field sensors and, moreparticularly, to rejection of stray magnetic fields during detection.

BACKGROUND

Magnetic field sensors are often used to detect a rotating magnetictarget. For example, a magnet may be placed at the end of a rotationshaft, such as a cam shaft or axle. A magnetic field sensor can beplaced adjacent to the magnet to detect it as the shaft rotates.

In some cases, the magnet and sensor are designed to detect an angularposition. The magnet may be positioned so that its polarity vectorrotates with the shaft. The sensor may be designed to detect thedirection of the polarity vector and calculate a positional angle of themagnet.

Extraneous or stray magnetic fields can make detection of the magnetless accurate and can induce errors in calculating the angle. Thesefields can be present in the ambient environment or produced by nearbyequipment or electronic devices.

SUMMARY

In an embodiment, a system comprises a magnetic target producing arotating magnetic field, a first set of magnetic field sensing elementsplaced in spaced relation to the magnetic target and comprising at leasta first magnetic field sensing element and a second magnetic fieldsensing element, each magnetic field sensing element having an axis ofmaximum sensitivity and a second set of magnetic field sensing elementsplaced in spaced relation to the magnetic target and comprising at leasta third magnetic field sensing element and a fourth magnetic fieldsensing element, each magnetic field sensing element having an axis ofmaximum sensitivity. The first set of magnetic field sensing elements ispositioned closer to a center point of the magnetic field than thesecond set of magnetic field sensing elements.

One or more of the following features may be included.

The axes of maximum sensitivity of the magnetic field sensing elementsof the first set may define a plane and the axes of maximum sensitivityof the magnetic field sensing elements of the second set may define aplane.

The plane defined by the first set and the plane defined by the secondset may be the same plane.

The axis of maximum sensitivity of the first magnetic field sensingelement may be orthogonal to the axis of maximum sensitivity of thesecond magnetic field sensing element and the axis of maximumsensitivity of the third magnetic field sensing element may beorthogonal to the axis of maximum sensitivity of the fourth magneticfield sensing element.

The axis of maximum sensitivity of the first magnetic field sensingelement may be parallel to the axis of maximum sensitivity of the thirdmagnetic field sensing element and the axis of maximum sensitivity ofthe second magnetic field sensing element may be parallel to the axis ofmaximum sensitivity of the fourth magnetic field sensing element.

The magnetic field sensing elements may be placed so that theirrespective axes of maximum sensitivity are at a respective predeterminedangle with respect to the magnetic field.

The rotating magnetic field may have a direction through the first andsecond sets of magnetic field sensing elements wherein: the angle of theaxis of maximum sensitivity of the first magnetic field sensing elementis about 180 degrees with respect to a centerline defined by the firstand second sets of magnetic field sensing elements; the angle of theaxis of maximum sensitivity of the second magnetic field sensing elementis about 90 degrees with respect to the centerline defined by the firstand second sets of magnetic field sensing elements; the angle of theaxis of maximum sensitivity of the third magnetic field sensing elementis about 180 degrees with respect to the centerline defined by the firstand second sets of magnetic field sensing elements; and the angle of theaxis of maximum sensitivity of the fourth magnetic field sensing elementis about 90 degrees with respect to the centerline defined by the firstand second sets of magnetic field sensing elements.

The magnetic field sensing elements may be placed so that theirrespective axes of maximum sensitivity are at a predetermined angle withrespect to an expected direction of a stray magnetic field.

The angle of the axis of maximum sensitivity of the first magnetic fieldsensing element may be about 90 degrees with respect to the expecteddirection of the stray magnetic field; the angle of the axis of maximumsensitivity of the second magnetic field sensing element may be about 45degrees with respect to the expected direction of the stray magneticfield; the angle of the axis of maximum sensitivity of the thirdmagnetic field sensing element may be about 90 degrees with respect tothe expected direction of the stray magnetic field; and the angle of theaxis of maximum sensitivity of the fourth magnetic field sensing elementmay be about 45 degrees with respect to the expected direction of thestray magnetic field.

The target may comprise a body comprising a cylinder.

A first half of the cylinder may have a first magnetic polarity and asecond half of the cylinder may have a second magnetic polarity.

The first and second halves of the cylinder may be defined by a planethrough which an axis of the cylinder runs.

The cylinder may be defined by four quadrants, where adjacent quadrantshave opposite magnetic polarities.

Each magnetic field sensing element may produce an output signalrepresenting the magnetic field as detected by the respective magneticfield sensing element.

A processing circuit may be coupled to receive the output signals of themagnetic field sensing elements and calculate a detected angle of themagnetic field.

The processing circuit may be configured to cancel the effect of a straymagnetic field having a direction substantially orthogonal to a linefrom the first set to the second set of magnetic field sensing elements.

The processing circuit may include one or more of: a circuit to performan arctangent function, a circuit to perform a sin function, and acircuit to perform a cosine function.

In another embodiment, a system comprises: a magnetic target producing arotating magnetic field; means for detecting the magnetic field andproducing one or more signals representing the magnetic field; means forcalculating an angle of the rotating magnetic field from the one or moresignals; and means for canceling effects of a stray magnetic field fromthe calculation of the angle.

In another embodiment, a system comprises a magnetic target producing arotating magnetic field; a first set of magnetic field sensing elementsplaced in spaced relation to the magnetic target to detect the magneticfield; a second set of magnetic field sensing elements placed in spacedrelation to the magnetic target to detect the magnetic field wherein thefirst set of magnetic field sensing elements is positioned closer to acenter point of the magnetic field than the second set of magnetic fieldsensing elements so that the first set of magnetic field sensingelements detects a stronger magnetic field than the second set ofmagnetic field sensing elements detects; wherein the first and secondset of magnetic field sensing elements are placed so that both setsdetect, with approximately equal strength, a stray magnetic field.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing features may be more fully understood from the followingdescription of the drawings. The drawings aid in explaining andunderstanding the disclosed technology. Since it is often impractical orimpossible to illustrate and describe every possible embodiment, theprovided figures depict one or more exemplary embodiments. Accordingly,the figures are not intended to limit the scope of the invention. Likenumbers in the figures denote like elements.

FIG. 1 is a diagram of a system for detecting a rotating target.

FIG. 2 is a diagram of a magnetic field sensor and a magnetic target.

FIG. 2A is a graph of magnetic field strength versus distance.

FIG. 3 is a diagram of another embodiment of a magnetic field sensor anda magnetic target.

FIG. 3A is a diagram of another embodiment of a magnetic field sensorand a magnetic target.

FIG. 3B is a diagram of another embodiment of a magnetic field sensorand a magnetic target.

FIG. 3C is a diagram of another embodiment of a magnetic field sensorand a magnetic target.

FIG. 4 is a diagram of another embodiment of a magnetic field sensor anda magnetic target.

FIG. 5 is a diagram of a magnetic target with a magnetic field sensor.

FIG. 6 is a diagram of a magnetic target with positioning of a magneticfield sensor.

FIG. 7 is a diagram of a magnetic field sensor showing a processingcircuit, and a magnetic target.

DETAILED DESCRIPTION

As used herein, the term “magnetic field sensing element” is used todescribe a variety of electronic elements that can sense a magneticfield. The magnetic field sensing element can be, but is not limited to,a Hall Effect element, a magnetoresistance element, or amagnetotransistor. As is known, there are different types of Hall Effectelements, for example, a planar Hall element, and a vertical Hallelement. As is also known, there are different types ofmagnetoresistance elements, for example, a semiconductormagnetoresistance element such as Indium Antimonide (InSb), a giantmagnetoresistance (GMR) element, an anisotropic magnetoresistanceelement (AMR), a tunneling magnetoresistance (TMR) element, and amagnetic tunnel junction (MTJ). The magnetic field sensing element maybe a single element or, alternatively, may include two or more magneticfield sensing elements arranged in various configurations, e.g., a halfbridge or full (Wheatstone) bridge. Depending on the device type andother application requirements, the magnetic field sensing element maybe a device made of a type IV semiconductor material such as Silicon(Si) or Germanium (Ge), or a type III-V semiconductor material likeGallium-Arsenide (GaAs) or an Indium compound, e.g., Indium-Antimonide(InSb).

As is known, some of the above-described magnetic field sensing elementstend to have an axis of maximum sensitivity parallel to a substrate thatsupports the magnetic field sensing element, and others of theabove-described magnetic field sensing elements tend to have an axis ofmaximum sensitivity perpendicular to a substrate that supports themagnetic field sensing element. In particular, planar Hall elements tendto have axes of sensitivity perpendicular to a substrate, while metalbased or metallic magnetoresistance elements (e.g., GMR, TMR, AMR) andvertical Hall elements tend to have axes of sensitivity parallel to asubstrate.

As used herein, the term “magnetic field sensor” is used to describe acircuit that uses a magnetic field sensing element, generally incombination with other circuits. Magnetic field sensors are used in avariety of applications, including, but not limited to, an angle sensorthat senses an angle of a direction of a magnetic field, a currentsensor that senses a magnetic field generated by a current carried by acurrent-carrying conductor, a magnetic switch that senses the proximityof a ferromagnetic object, a rotation detector that senses passingferromagnetic articles, for example, magnetic domains of a ring magnetor a ferromagnetic target (e.g., gear teeth) where the magnetic fieldsensor is used in combination with a back-biased or other magnet, and amagnetic field sensor that senses a magnetic field density of a magneticfield.

As used herein, the terms “target” and “magnetic target” are used todescribe an object to be sensed or detected by a magnetic field sensoror magnetic field sensing element.

FIG. 1 shows an example of a system 100 for detecting a magnetic target102. Target 102 may be placed at the end of rotating shaft 104. Inembodiments, rotating shaft may be a cam shaft, an axle, a spindle, aspool, or any type of machine that rotates.

Magnetic target 102 may be polarized so that it has a north section 106and a south section 108. In the case of a cylindrical target 102, northsection 106 and south section 108 may each comprise a horizontalcylindrical segment of target 102. The polarization of magnet 102 mayproduce a magnetic field vector in the direction of vector 110.

A magnetic field sensor 112 may be positioned adjacent to target 102 todetect the magnetic field. As shaft 104 rotates, magnetic field vector110 may also rotate. Magnetic field sensor 112 may be configured todetect the magnetic field and the angle of its rotation.

Magnetic field sensor 112 may be communicatively coupled to a processor114. As an example, if shaft 104 is a camshaft in a vehicle, processor114 may be an in-vehicle computer that may control the vehicle based, inpart, on information provided by sensor 112. As sensor 112 detects themagnetic field, it may send information about the magnetic field (suchas position, speed of rotation, phase, angle, etc.) to processor 114.Magnetic field sensor 112 may also communicate information about anyerrors encountered to processor 114.

Referring to FIG. 2, a system 200 includes a magnetic field sensor 202,which may be the same as or similar to magnetic field sensor 112, and atarget 204, which may be the same as or similar to target 102. Target204 may produce magnetic field 206. For ease of illustration, magneticfield 206 produced by target 204 is illustrated by straight magneticfield lines 208. However, the direction of magnetic field 206 may bedifferent from that shown by magnetic field lines 208. For example,magnetic field lines 208′ may present a more realistic depiction of amagnetic field produced by target 204. One skilled in the art willrecognize that, throughout the figures, magnetic fields may be drawnwith straight lines for ease of illustration, but may take other shapes,forms, and directions depending on the type and shape of the magneticsource. Even though a magnetic field is drawn in the figures usingstraight lines, it does not necessarily indicate that the magnetic fieldhas uniform field strength along those lines, unless specificallydescribed as uniform in the text. For example, the magnetic fielddepicted by magnetic field lines 208 will have greater strength (e.g.flux density) around pair 218 (closer to target 204) and relativelyweaker strength around pair 212 (further away from target 204).

Magnetic field sensor 202 may be positioned adjacent to target 204 todetect magnetic field 206 as target 204 rotates and compute an angle ofrotation of target 204. Magnetic field lines 210 represent an external,or stray, magnetic field that can influence detection of magnetic field206 by sensor 202 and potentially cause errors or inaccuracies.

In embodiments, magnetic field sensor 202 may include a first set 212 ofmagnetic field sensing elements 214 and 216, and a second set 218 ofmagnetic field sensing elements 220 and 222. Each set may contain a pairof magnetic field sensing elements. In other embodiments, each set maycontain more than two magnetic field sensing elements.

Magnetic field sensing element 202 may be positioned so that set 218 iscloser to target 204 than set 212. Thus, magnetic field sensing elements220 and 222 may be subject to and detect a stronger magnetic field 206than that which is detected by magnetic field sensing elements 214 and216.

Magnetic field 210 may be a uniform magnetic field that affects magneticfield sensing elements 220, 222, 214, and 216 substantially equally.Thus, in contrast to magnetic field 208, magnetic fields sensingelements 220, 222, 216, and 216 may be subject to and detect asubstantially equal stray magnetic field 210.

Each magnetic field sensing element 214, 216, 220, and 222 has an axisof maximum sensitivity (as described above) represented by arrows 224,226, 228, and 230, respectively. The axes of maximum sensitivity 224 and226 may be viewed as non-parallel vectors and thus may define a firstplane. Similarly, the axes of maximum sensitivity 228 and 23 o may beviewed as non-parallel vectors and thus may define a second plane. Inembodiments, the first and second planes may be the same (orsubstantially the same) plane as shown in FIG. Magnetic field sensingelements 214, 216, 228, and 230 may be placed within the plane formed bythe axes of maximum sensitivities, with set 212 of magnetic fieldsensing elements 214 and 216 being further away from target 204 than set218 of magnetic field sensing elements 220 and 222.

In embodiments, axis of maximum sensitivity 224 of magnetic fieldsensing element 214 is orthogonal to axis of maximum sensitivity 226 ofmagnetic field sensing element 216, and the axis of maximum sensitivity228 of magnetic field sensing element 220 is orthogonal to the axis ofmaximum sensitivity 230 of magnetic field sensing element 222.

As shown in FIG. 2, axes of maximum sensitivity 224 and 226 form aninety-degree angle with each other. In an embodiment, magnetic fieldsensing elements 214 and 216 may also be placed so that their respectiveaxes of maximum sensitivity form a forty-five degree angle with respectto magnetic field 206. Similarly, axes of maximum sensitivity 228 and230 form a ninety-degree angle with each other. In an embodiment,magnetic field sensing elements 220 and 222 may also be placed so thattheir respective axes of maximum sensitivity form a forty-five-degreeangle with respect to magnetic field 206.

One skilled in the art will recognize that the respective angle formedby the axes of maximum sensitivity 224, 226, 228, and 230 may bedescribed with various coordinate systems. For example, using an angularcoordinate system 232 and assuming centerline 234 is parallel to theexpected direction of magnetic field 206, the angle between axis ofmaximum sensitivity 226 and centerline 234 is about 180 degrees; theangle between axis of maximum sensitivity 224 and centerline 234 isabout 90 degrees; the angle between the axis of maximum sensitivity 230and centerline 234 is about 180 degrees; and the angle between axis ofmaximum sensitivity 228 and centerline 234 is about 90 degrees withrespect to centerline 234.

As noted above, stray magnetic field 210 may have an expected directionthat is orthogonal to magnetic field 206. Thus, in one example, themagnetic field sensing elements may be placed so that the angle betweenaxis of maximum sensitivity 226 and stray magnetic field 210 may be 90degrees; the angle between axis of maximum sensitivity 224 and straymagnetic field 210 may be 45 degrees; the angle between axis of maximumsensitivity 230 and stray magnetic field 210 may be 90 degrees; and theangle between axis of maximum sensitivity 228 and stray magnetic field210 may be 45 degrees.

Target 204 may be a cylindrical, rotating target. In some instances,target 204 may be an end-of-shaft magnetic target that may be placed onthe end of a rotating shaft. Target 204 may comprise two horizontalcylindrical segments 236 and 238 formed by a plane (represented by line240) that runs parallel to and through the cylinders axis of symmetry.Segments 236 and 238 may have opposite magnetic polarity—magnetic southfor segment 236 and magnetic north for segment 238, for example.

As target 204 rotates, so does magnetic field 206. Each magnetic fieldsensing element 214, 216, 220, and 222 may detect magnetic field 206 andproduce an output signal representing magnetic field 206 as detected bythe respective magnetic field sensing element.

The positioning of the pairs 212 and 218 may allow magnetic field sensor202 to detect magnetic field 206 while reducing interference or errorsfrom stray field 210. For example, because set 212 is further fromtarget 204 than is set 218, set 212 may detect a weaker magnetic field206 than that detected by set 218.

Referring to FIG. 2A, graph 250 illustrates the difference in magneticfield strength experienced by the pairs of magnetic field sensingelements. In graph 250, the horizontal axis represents distance betweenthe magnetic field sensing element and the target, and the vertical axisrepresents the magnetic field as detected by a magnetic field sensingelement. If set 218 is placed at a distance of about 2 mm from thetarget, it may experience 800 Gauss of field strength, according topoint 252. If set 212 is placed at a distance of about 3 mm from thetarget, it may experience 600 Gauss of field strength, according topoint 254.

The field strength difference may also be detected by magnetic fieldsensing elements placed in two 3D sensing groups. These groups may be inthe same die, or on different die, so long as their respective spacingfrom the target is maintained. If they are placed on the same die, thedie may be positioned perpendicular to the target so that one group (orset) of magnetic field sensing elements is further from the target thanthe other.

Referring again to FIG. 2, in embodiments, magnetic field 210 may be asubstantially uniform magnetic field. Thus, set 212 and set 218 maydetect magnetic field 210 with the same magnitude or strength. Aprocessor (such as processor 114 in FIG. 1) may receive the outputs fromeach set 212 and 218 and use the varying magnetic field strengthsdetected by pairs 212 and 218 to calculate an angle of magnetic field206 while reducing or minimizing the effect that magnetic field 210 hason the calculation.

Referring to FIG. 3, in an embodiment, system 200′ may include magneticfield sensor 202 and target 240 arranged so that magnetic field sensor202 is orthogonal to the cylindrical (e.g. center) axis of target 240.In this embodiment, the cylindrical axis of target 240 may perpendicular(into and out of) the page. Magnetic field sensor 202 may be arranged sothat set 218 is closer to target 240 (i.e. closer to the central axis)than is set 212. In this embodiment, the stray field may have anexpected direction orthogonal to magnetic field 206 (i.e. an expecteddirection into or out of the page). In other embodiments, the strayfield may have an expected direction along the plane of the page,similar to that of stray magnetic field 210 shown in FIG. 2.

In this arrangement, magnetic field sensing element 212 may bepositioned further away that magnetic field sensing element pair 218from target 240. In an embodiment, magnetic field sensing element pair212, magnetic field sensing element pair 218, and target 240 may bearranged in a line. The strength of magnetic field 206 may be greatercloser to target 240 and relatively weaker further away from target 240.As a result, magnetic field sensing element pair 218 may detect astronger magnetic field than magnetic field sensing element pair 212.

Referring to FIG. 3A, system 200″ may include magnetic field sensor 202′having magnetic field sensing element pair 212′ and magnetic fieldsensing element pair 218′. Magnetic field sensor 202′ may be positionedso that a line 302 drawn through the center of pair 212′ and pair 218′is substantially perpendicular to a line 304 drawn through the center306 of magnetic field sensor 202′ and the center 308 of target 240.

In embodiments, target 240 may rotate about an axis of rotation thatpasses through center point 308 and goes into and out of the page. Inother words, target 240 may rotate in a clockwise and/orcounterclockwise direction, as shown by arrow 310, about center point308.

As target 240 rotates, the magnetic field 206 it produces also rotatesabout the axis of rotation. As magnetic field 206 rotates past magneticfield sensing element pairs 212′ and 218′, the magnetic field sensingelements will detect changes in the magnetic field due to its rotation.Assume that magnetic field 206 is rotating in a counterclockwisedirection. Magnetic field sensing element pair 218′ may detect aparticular level or a particular change in magnetic field 206 beforemagnetic field sensing element pair 212′ does. Thus, an output signalfrom magnetic field sensing element pair 218′ may reflect the particularchange or level before an output signal from magnetic field sensingelement pair 212′ does. In other words, in this arrangement, there maybe a phase difference between the output signals of the magnetic fieldsensing elements of pair 218′ and the magnetic field sensing elements ofpair 212′. This phase difference may be used to detect speed ofrotation, direction of rotation, position of target 240, etc.

Referring to FIG. 3B, in an embodiment, system 300B may include magneticfield sensor 312 and target 314. Target 314 may be a cylindrical or flatrod-shaped target configured to move back and/or forth along line 316 asshown by arrow 318. Target 314 may include a magnetic north segment 320directly adjacent to a magnetic south segment 322. Although two segments320, 322 are shown, target 314 may include additional segments coupledtogether so that adjacent segments have opposite magnetic poles. Inembodiments, target 314 may have one or more non-magnetic segmentsadjacent to magnetic segments. The magnetic segments surrounding anon-magnetic segment may have opposite magnetic poles or the samemagnetic poles.

Magnetic field sensor 312 may include a first pair 324 of magnetic fieldsensing elements and a second pair 326 of magnetic field sensingelements. Magnetic field sensor 312 may arranged so that a line drawnfrom the center of pair 326 to the center of pair 324 is substantiallyperpendicular to the line of travel 316 of target 314. Pair 324 may becloser than pair 326 to target 314. As a result, the magnetic fieldsensing elements of pair 324 may detect a stronger magnetic field thanthe magnetic field sensing elements of pair 326.

Referring to FIG. 3C, in an embodiment, system 300C may include magneticfield sensor 328 and target 314. Target 314 may be a cylindrical or flatrod-shaped target configured to move back and/or forth along line 316 asshown by arrow 318. Target 314 may include a magnetic north segment 320directly adjacent to a magnetic south segment 322. Although two segments320, 322 are shown, target 314 may include additional segments coupledtogether so that adjacent segments have opposite magnetic poles. Inembodiments, target 314 may have one or more non-magnetic segmentsadjacent to magnetic segments. The magnetic segments surrounding anon-magnetic segment may have opposite magnetic poles or the samemagnetic poles.

Magnetic field sensor 328 may include a first pair 330 of magnetic fieldsensing elements and a second pair 332 of magnetic field sensingelements. Magnetic field sensor 328 may arranged so that a line 334drawn from the center of pair 330 to the center of pair 332 issubstantially parallel to the line of travel 316 of target 314.

In embodiments, target 314 may move translationally in the directionsindicated by arrow 318. As target 314 moves, the magnetic field itproduces also moves. As the magnetic field moves past or throughmagnetic field sensing element pairs 330 and 332, the magnetic fieldsensing elements will detect changes in the magnetic field due to itsmovement. Assume that target 314 is moving in a left-to-right directionon the page. Magnetic field sensing element pair 330 may detect aparticular level or a particular change in the magnetic field beforemagnetic field sensing element pair 332 does. Thus, an output signalfrom magnetic field sensing element pair 330 may reflect the particularchange or level before an output signal from magnetic field sensingelement pair 332 does. In other words, in this arrangement, there may bea phase difference between the output signals of the magnetic fieldsensing elements of pair 330 and the magnetic field sensing elements ofpair 332. This phase difference may be used to detect speed of rotation,direction of rotation, position of target 314, etc.

Referring to FIG. 4, in an embodiment, system 200″ may include magneticfield sensor 202 and target 240 arranged so that magnetic field sensor202 overlaps a flat surface 402 of target 202. In other embodiments,magnetic field sensor may be offset from the center of target 240.

Referring to FIG. 5, system 500 may include a magnetic field sensor 502,which may be the same as or similar to magnetic field sensor 202.Magnetic field sensor 502 may be placed adjacent to target 504 to detecta magnetic field produced by target 504.

Target 504 may comprise four quadrants 506-512. Each adjacent quadrantmay have opposite magnetic polarities. For example, quadrant 506 and 508may be adjacent because they share an edge 514. Thus, quadrant 506 mayhave a south polarity and quadrant 508 may have a north polarity.Quadrant 508 and 512 may be adjacent because they share an edge 516.Thus, quadrant 512 may have a south polarity and quadrant 508 may have anorth polarity. Quadrant 510 may have a north polarity and share edgeswith south polarity quadrants 506 and 512.

The four quadrants 506-512 may produce a magnetic field with adirection, in part, that is substantially parallel to the top surface oftarget 504 as shown, for example, by magnetic field lines 520. Magneticfield sensor 502 may be offset from the center of target 504 to detectthe magnetic field produced by target 504 as target 504 rotates. Inanother embodiment, magnetic field sensor 502 may be positioned adjacentto the circumference of target 504.

Referring to FIG. 6, the magnetic field sensor may be centered inposition 602 over target 504, or may be offset, as shown by positions604. As noted above, the magnetic field sensor may have two (or more)pairs or sets of magnetic field sensing elements. (See set 212 and set218 in FIG. 2). In embodiments, one set of magnetic field sensingelements may be positioned closer to the center of target 504 at, forexample, position 602. The other set of magnetic field sensing elementsmay be further offset from the center of target 504 at, for example, oneof the positions 604. Separation of the sets of magnetic field sensingelements may result in one set detecting a stronger magnetic field fromtarget 504 and the other set detecting a weaker magnetic field fromtarget 504. The difference in detected field strength may be utilized toreject stray magnetic fields, as described above.

Referring to FIG. 7, system 700 may include magnetic field sensor 202and target 702. Target 702 may be the same as or similar to target 204or 504. System 700 may also include a substrate 704, which may be asemiconductor substrate, and which may support processing circuit 706(e.g. processing circuit 706 may be formed in and/or on substrate 704).Substrate 704 may also support magnetic field sensor 202 and magneticfield sensing elements 214, 216, 220, 222.

Processing circuit 706 may include circuitry to receive signals frommagnetic field sensing elements 214, 216, 220, 222, which representdetection of magnetic field 206, and may calculate an angle of rotationof magnetic field 206, a speed of rotation of magnetic field 206, etc.To perform the calculation, processing circuit 706 may include customcircuitry and/or processor executing software or firmware code thatcalculates the angle of the magnetic field. Processing circuit 706 mayalso generate an output signal 708 representing the computed angle,speed, etc.

Immunity to stray field 210 may be accomplished by utilizing the varyinglevels of signal intensity from the magnetic field sensing elements. Asnoted above, magnetic field sensing elements 220 and 222 may detect astronger magnetic field 206 than magnetic field sensing elements 214 and216 detect, because magnetic field sensing elements 220 and 222 may becloser to target 702.

Processor 706 may use the following equations to compute the detectedmagnetic field:

H1y=AB ₁ sin θ_(B) +AB _(stray) sin θ_(stray)  (1)

H1x=AB ₁ cos θ_(B) +AB _(stray) cos θ_(stray)  (2)

H2y=AkB ₁ sin θ_(B) +AB _(stray) sin θ_(stray)  (3)

H2x=AkB ₁ cos θ_(B) +AB _(stray) cos θ_(stray)  (4)

In the equations above, H1 y is the output signal of magnetic fieldsensing element 216, H1 x is the output signal of magnetic field sensingelement 214, H2 y is the output of magnetic field sensing element 222,H2 x is the output of magnetic field sensing element 222, A is a scalarsensitivity factor of the magnetic field sensing elements, B₁ ismagnetic field 206, B_(stray) is stray magnetic field 210, and k is ascaling factor representing the difference in magnetic field strength asdetected by set 212 and set 218 (see FIG. 2).

Subtracting equations 4 from 1 and 3 from 2 removes the effect of thestray field and reduces the equations to the following:

Hydiff=(1−k)AB ₁ sin θ_(B)  (5)

Hxdiff=(1−k)AB ₁ cos θ_(B)  (6)

The angle of rotation of the magnetic field can be calculated with thefollowing formula:

$\begin{matrix}{\theta_{B} = {\arctan \left( \frac{Hydiff}{Hxdiff} \right)}} & (7)\end{matrix}$

Processing circuit 706 may provide the signal θ_(B) as output signal708.

Having described preferred embodiments, which serve to illustratevarious concepts, structures and techniques, which are the subject ofthis patent, it will now become apparent to those of ordinary skill inthe art that other embodiments incorporating these concepts, structuresand techniques may be used. Accordingly, it is submitted that that scopeof the patent should not be limited to the described embodiments butrather should be limited only by the spirit and scope of the followingclaims. All references cited in this disclosure are incorporated here byreference in their entirety.

1. A system comprising: a magnetic target producing a rotating magneticfield; a first set of magnetic field sensing elements placed in spacedrelation to the magnetic target to detect the rotating magnetic field;and a second set of magnetic field sensing elements placed in spacedrelation to the magnetic target to detect the rotating magnetic field,wherein the first set of magnetic field sensing elements is positionedcloser to a center point of the rotating magnetic field than the secondset of magnetic field sensing elements so that the first set of magneticfield sensing elements detects a stronger rotating magnetic field thanthe second set of magnetic field sensing elements detects, and whereinthe first and second set of magnetic field sensing elements are placedso that the first and second sets of magnetic field sensing elementseach detect, with approximately equal strength, a stray magnetic field.2. The system of claim 1, wherein the axes of maximum sensitivity of themagnetic field sensing elements of the first set define a first planeand the axes of maximum sensitivity of the magnetic field sensingelements of the second set define a second plane, and wherein the axisof maximum sensitivity of the first magnetic field sensing element isorthogonal to the axis of maximum sensitivity of the second magneticfield sensing element.
 3. The system of claim 2, wherein the first planeand the second plane are the same plane.
 4. The system of claim 2,wherein the axis of maximum sensitivity of the third magnetic fieldsensing element is orthogonal to the axis of maximum sensitivity of thefourth magnetic field sensing element.
 5. The system of claim 4, whereinthe axis of maximum sensitivity of the first magnetic field sensingelement is parallel to the axis of maximum sensitivity of the thirdmagnetic field sensing element, and wherein the axis of maximumsensitivity of the second magnetic field sensing element is parallel tothe axis of maximum sensitivity of the fourth magnetic field sensingelement.
 6. The system of claim 5, wherein the first and second magneticfield sensing elements are on opposite sides of a centerline, thecenterline being parallel to the magnetic field, and wherein the thirdand fourth magnetic field sensing elements are on opposite sides of thecenterline.
 7. The system of claim 6, wherein the centerline is parallelto the first plane.
 8. The system of claim 1, wherein the targetcomprises a body comprising a cylinder.
 9. The system of claim 8,wherein a first half of the cylinder has a first magnetic polarity and asecond half of the cylinder has a second magnetic polarity.
 10. Thesystem of claim 9, wherein the first and second halves of the cylinderare defined by a plane through which an axis of the cylinder runs. 11.The system of claim 8, wherein the cylinder is defined by fourquadrants, where adjacent quadrants have opposite magnetic polarities.12. The system of claim 1, wherein the target comprises a rod.
 13. Thesystem of claim 12, wherein the rod comprises two or more segmentshaving different magnetic polarity.
 14. The system of claim 1, whereineach magnetic field sensing element produces an output signalrepresenting the magnetic field as detected by the respective magneticfield sensing element.
 15. The system of claim 14, further comprising aprocessing circuit coupled to receive the output signals of the magneticfield sensing elements and calculate a detected angle of the magneticfield.
 16. The system of claim 15, wherein the processing circuit isconfigured to cancel the effect of a stray magnetic field having adirection substantially orthogonal to a line from the first set to thesecond set of magnetic field sensing elements.
 17. The system of claim16, wherein the processing circuit includes one or more of: a circuit toperform an arctangent function, a circuit to perform a sine function,and a circuit to perform a cosine function.
 18. A system comprising: amagnetic target producing a rotating magnetic field; a first set ofmagnetic field sensing elements placed in spaced relation to themagnetic target to detect the rotating magnetic field; and a second setof magnetic field sensing elements placed in spaced relation to themagnetic target to detect the rotating magnetic field, wherein the firstset of magnetic field sensing elements is positioned so that the firstset of magnetic field sensing elements detects a stronger rotatingmagnetic field than the second set of magnetic field sensing elementsdetects, wherein the first and second set of magnetic field sensingelements are placed so that the first and second sets of magnetic fieldsensing elements each detect, with approximately equal strength, a straymagnetic field, wherein the axes of maximum sensitivity of the magneticfield sensing elements of the first set define a first plane and theaxes of maximum sensitivity of the magnetic field sensing elements ofthe second set define a second plane, wherein the axis of maximumsensitivity of the first magnetic field sensing element is orthogonal tothe axis of maximum sensitivity of the second magnetic field sensingelement, wherein the axis of maximum sensitivity of the third magneticfield sensing element is orthogonal to the axis of maximum sensitivityof the fourth magnetic field sensing element, wherein the axis ofmaximum sensitivity of the first magnetic field sensing element isparallel to the axis of maximum sensitivity of the third magnetic fieldsensing element, and wherein the axis of maximum sensitivity of thesecond magnetic field sensing element is parallel to the axis of maximumsensitivity of the fourth magnetic field sensing element.
 19. The systemof claim 18, wherein the first and second magnetic field sensingelements are on opposite sides of a centerline, the centerline beingparallel to the magnetic field, and wherein the third and fourthmagnetic field sensing elements are on opposite sides of the centerline.